<template>
	<div class="app">
		<h3 ref="test">我是App组件</h3>
		<h4>{{msg}}</h4>
		<button @click="showH3Text">点我提示h3标签中内容</button>
		<School ref="xuexiao"/>
	</div>
</template>

<script>
	import School from './components/School'

	export default {
		name:'App',
		components:{School},
		data() {
			return {
				msg:'欢迎学习Vue'
			}
		},
		methods:{
			showH3Text(){
				alert(this.$refs.test.innerText)
				console.log(this.$refs.xuexiao) //输出的是School组件的实例对象（vc）
			}
		}
	}
</script>

<style>
	.app{
		background-color: gray;
		padding: 30px;
	}
</style>
